#include "stmtLstTable.h"


StmtLstTable::StmtLstTable()
{
	_size = 0;
}

vector<node_stmt> StmtLstTable::getStmtLst() {
	return _table;
}
INDEX StmtLstTable::insertStmtLstTable(string type, INTEGER startLine, INTEGER endLine){
	node_stmt temp = {type, startLine, endLine};
/*	for (int i=0; i<_size; i++) {
		node_stmt t = _table.at(i);
		if ((t.start == startLine) && (t.end == endLine) && (strcmp(t.type.c_str(),type.c_str())==0)) {
			return i;
		}
	}*/
	_table.push_back(temp);
	_size++;
	return (_size-1);
}
INTEGER StmtLstTable::getSize() {
	return _size;
}
node_stmt StmtLstTable::getStmtLst(INDEX index){
	return _table.at(index);
}
BOOLEAN StmtLstTable::setStartLine(INDEX index,INTEGER startLine){
	_table.at(index).start = startLine;
	return true;
}
BOOLEAN StmtLstTable::setEndLine(INDEX index,INTEGER endLine){
	_table.at(index).end = endLine;
	return true;
}
INDEX StmtLstTable::getStartLine(INDEX index) {
	return _table.at(index).start;
}
INDEX StmtLstTable::getEndLine(INDEX index) {
	return _table.at(index).end;
}
string StmtLstTable::getType(INDEX index) {
	return _table.at(index).type;
}